<!DOCTYPE html>
<html>
<head>
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<script type="application/x-javascript">
	addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); 
	function hideURLbar(){ window.scrollTo(0,1); }
</script>
<link rel="stylesheet" href="__INDEX__/css/zcdl.css"/>
<script type="text/javascript" src="__INDEX__/js/jquery.min.js"></script>
<script type="text/javascript" src="__INDEX__/js/easyResponsiveTabs.js"></script>
</head>
<body>
	<div class="zcdlmain">
		<div class="login-form">
			<div class="sap_tabs w3ls-tabs">
				<div id="horizontalTab" style="display: block; width: 100%; margin: 0px;">
					<ul class="resp-tabs-list">
						<li class="resp-tab-item" aria-controls="tab_item-0" role="tab">
							<span>登录</span>
						</li> 
						<li class="resp-tab-item" aria-controls="tab_item-1" role="tab">
							<label>/</label>
							<span>注册</span>
						</li>
					</ul>
					<a href="<{:url('index/index')}>">
						<div class="zcdlbackhome">返回主页</div>
					</a>
					<div class="clear"> </div>
					<div class="resp-tabs-container">
						<div class="tab-1 resp-tab-content" aria-labelledby="tab_item-0">
							<div class="login-agileits-top"> 
								<form action="<{:url('register/login')}>" method="post">
									<p>用户名</p>
									<input type="text" name="username"  required=""/>
									<p>密码</p>
									<input type="password" name="password" required=""/>	 
									<input type="checkbox" id="brand" value="2">
									<label for="brand"><span></span> 记住密码</label> 
									<input type="submit" value="登录">
								</form>  
							</div>
							<div class="login-agileits-bottom"> 
								<p><a href="<{:}>">忘记密码?</a></p>
							</div> 
						</div> 
						<div class="tab-1 resp-tab-content" aria-labelledby="tab_item-1">
							<div class="login-agileits-top sign-up"> 
								<p>用户名（邮箱/手机号）</p>
								<input type="text" name="username" id="regusername" required=""/>
								<p>密码</p>
								<input type="password" name="password" id="regpassword" required=""/>
								<p>确认密码</p>
								<input type="password" name="repassword" id="regrepassword" required=""/>
								<input type="checkbox" id="brand1" name="yes" value="">
								<label for="brand1">
									<span></span>同意使用，遵守条例
								</label> 
								<input type="submit" onclick="reg()" value="注册">
							</div>
						</div>
					</div>							
				</div>	 
			</div> 
			<!-- ResponsiveTabs js -->
			<script type="text/javascript">
				$(document).ready(function () {
					$('#horizontalTab').easyResponsiveTabs({
						type: 'default', //Types: default, vertical, accordion           
						width: 'auto', //auto or any width like 600px
						fit: true   // 100% fit in a container
					});
					//判断点进来的链接是登陆还是注册 
					var url = location.href.split("#");
					if(url[1]=='reg'){
						//注册
						$("li[aria-controls='tab_item-1']").addClass('resp-tab-active');
						$("div[aria-labelledby='tab_item-1']").addClass('resp-tab-content-active');
						$("div[aria-labelledby='tab_item-1']").css('display','block');
						// 登陆
						$("li[aria-controls='tab_item-0']").removeClass('resp-tab-active');
						$("div[aria-labelledby='tab_item-0']").removeClass('resp-tab-content-active');
						$("div[aria-labelledby='tab_item-0']").css('display','none');
					}else{
						//登陆
						$("li[aria-controls='tab_item-0']").addClass('resp-tab-active');
						$("div[aria-labelledby='tab_item-0']").addClass('resp-tab-content-active');
						$("div[aria-labelledby='tab_item-0']").css('display','block');
						//注册
						$("li[aria-controls='tab_item-1']").removeClass('resp-tab-active');
						$("div[aria-labelledby='tab_item-1']").removeClass('resp-tab-content-active');
						$("div[aria-labelledby='tab_item-1']").css('display','none');
					}
				});
			</script>
			<!-- //ResponsiveTabs js -->
			<script type="text/javascript">
				// 注册请求
				function reg(){
				var username=$('#regusername').val();
				var password=$('#regpassword').val();
				var repassword=$('#regrepassword').val();
					if(username==''){
						alert('用户名不可为空');
						return false;
					}else if(password==''){
						alert('密码不能为空');
						return false;
					}else if(password!=repassword){
						alert('两次密码不一致');
						return false;
					}else if($('#brand1').is(':checked')==false){
						alert('请选择`同意使用，遵守条例`');
						return false;
					}
					$.post("<{:url('register/reg')}>",{'username':username,'password':password,'repassword':repassword},function(data){
						if(data.message=='success'){
							window.location.href = "/api/register/gerenadd";
							alert('注册成功');
						}else{
							alert(data.flag);
						}	
					},'json');
				}
			</script>
		</div>	
	</div>
	<div class="copyright">
		<p> © 2017 铭家</p>
	</div>
</body>
</html>